/*
 * @file com.chuanlian.mini.enums.UserTypeEnum.java
 * @date 2021/9/10
 * @author lhz
 * @copyright 马丁洛克 Corporation 2021 版权所有
 * @version 0.0.1
 */
package com.sinux.generality.provider.pay.constants;

/****
 * @className RefundStatusEnum
 * @describe 退款状态枚举
 * @author lhz
 * @date  2022/03/07 11:13
 * @version 0.0.1
 */

public enum RefundStatusEnum {
    /**
     * 退款中
     */
    PROCESSING("PROCESSING",1),
    /**
     * 退款成功
     */
    SUCCESS("SUCCESS",2),
    /**
     * 退款异常
     */
    ABNORMAL("ABNORMAL",3),
    /**
     * 退款关闭
     */
    CLOSED("CLOSED",4);

    private String code;
    private Integer status;

     RefundStatusEnum(String code, Integer status) {
        this.code = code;
        this.status = status;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public static Integer getStatus(String code) {
        if (code == null) {
            return null;
        } else {
            for (RefundStatusEnum s : RefundStatusEnum.values()) {
                if (s.getCode().equals(code)) {
                    return s.getStatus();
                }
            }
            return null;
        }
    }
}